package com.easyweb.entity;

// Generated May 29, 2009 4:16:57 PM by Hibernate Tools 3.2.4.GA

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.OneToMany;

import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;

import org.hibernate.annotations.CacheModeType;
import org.hibernate.annotations.NamedQueries;
import org.hibernate.annotations.NamedQuery;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * Bankatanimlari generated by hbm2java
 */
@Entity
@NamedQueries( {					
	@NamedQuery(cacheable=true,cacheMode=CacheModeType.NORMAL, name = "bankaTumKayitlar", query = "select b from BankaTanimlari b  where (b.iptal IS NULL OR  b.iptal = ' ' OR b.iptal <> '*') order by b.bankaAdi")
}
)
@Table 
public class BankaTanimlari   {

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	private Long id;

	@Version
	@Column(name = "version")
	private Integer version;
	
	@Column(name = "bankaAdi", nullable = false, length = 100)
	@NotNull(message="#{messages.errBosOlamaz}")
	@Length(max = 100,message="#{messages.errUzunlukElliGecemez}")
	private String bankaAdi;
	
	@Column(name = "bankaKodu", nullable = false, length = 5)
	@NotNull(message="#{messages.errBosOlamaz}")
	@Length(max = 5,message="#{messages.errUzunlukBesGecemez}")
	private String bankaKodu;
	
	@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY,mappedBy="bankaTanimlari")
	private List<BankaSubeleri> bankaSubeleris;

	@Column(name = "iptal", length = 1)
	private Character iptal;
	
	public BankaTanimlari() {
	}

  	public BankaTanimlari(String bankaAdi, String bankaKodu,
			List<BankaSubeleri> bankaSubeleris) {
		super();
		this.bankaAdi = bankaAdi;
		this.bankaKodu = bankaKodu;
		this.bankaSubeleris = bankaSubeleris;
	}
 
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	
	public Integer getVersion() {
		return this.version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

	
	public String getBankaAdi() {
		return this.bankaAdi;
	}

	public void setBankaAdi(String bankaAdi) {
		this.bankaAdi = bankaAdi;
	}

	public String getBankaKodu() {
		return this.bankaKodu;
	}

	public void setBankaKodu(String bankaKodu) {
		this.bankaKodu = bankaKodu;
	}

	public List<BankaSubeleri> getBankaSubeleris() {
		return bankaSubeleris;
	}

	public void setBankaSubeleris(List<BankaSubeleri> bankaSubeleris) {
		this.bankaSubeleris = bankaSubeleris;
	}

	public Character getIptal() {
		return iptal;
	}

	public void setIptal(Character iptal) {
		this.iptal = iptal;
	}

}
